import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Mall from '../views/Mall.vue'
import Login from '../views/login.vue'
import HomeView from '../views/heme/HomeView.vue'
import KanbanView from '../views/heme/KanbanView.vue'
import menuView from '../views/test/menu.vue'

//基础档案
import DepartmentView from '../views/basic/DepartmentView.vue'
import MeasuringUnitView from '../views/basic/MeasuringUnitView.vue'
import RoleinfoView from '../views/basic/RoleinfoView.vue'
import UserinfoView from '../views/basic/UserinfoView.vue'
import MenuInfoView from '../views/basic/MenuInfoView.vue'

//车间管理
import FoundationView from '../views/shopfloor/FoundationView.vue'
import ProductionLineView from '../views/shopfloor/ProductionLineView.vue'
import WorkshopinfoView from '../views/shopfloor/WorkshopinfoView.vue'
import WorkStationView from '../views/shopfloor/WorkStationView.vue'

//班组
import SchedulingPlanView from '../views/crew/SchedulingPlanView.vue'
import TeamBillView from '../views/crew/TeamBillView.vue'
import TeamTypeView from '../views/crew/TeamTypeView.vue'


//工艺
import CraftBillView from '../views/processRoute/CraftBillView.vue'
import ProcessView from '../views/processRoute/ProcessView.vue'


//产品
import MaterialsView from '../views/productPlanning/MaterialsView.vue'
import ProductBillView from '../views/productPlanning/ProductBillView.vue'
import ProductClassifyView from '../views/productPlanning/ProductClassifyView.vue'


//生产工单
import ProductionTaskView from '../views/production/ProductionTaskView.vue'
import WorkOrderView from '../views/production/WorkOrderView.vue'


//设备管理
import EquipmentClassifyView from '../views/equipment/EquipmentClassifyView.vue'
import EquipmentManagementView from '../views/equipment/EquipmentManagementView.vue'


const routes: Array<RouteRecordRaw> = [
  {
    path: '/Login',
    name: '登录',
    component: Login
  },
  {
    path: '/',
    component: Mall,
    redirect:'/Home',//重定向
    children: [
      {
        path: '/Home',
        name:'首页',
        component: HomeView
      }, 
      {
        path: '/Kanban',
        name:'看板',
        component: KanbanView
      }, 
      {
          path: '/basic/Department',
          name:'部门管理',
          component: DepartmentView
      },
      {
        path: '/basic/Userinfo',
        name:'用户信息',
        component: UserinfoView
    },
    {
      path: '/basic/Roleinfo',
      name:'角色管理',
      component: RoleinfoView
    },
    {
      path: '/basic/MeasuringUnit',
      name:'计量单位',
      component: MeasuringUnitView
    },
    {
      path: '/basic/MenuInfo',
      name:'菜单',
      component: MenuInfoView
    },

    // 车间管理
    {
      path: '/shopfloor/Foundation',
      name:'基地',
      component: FoundationView
    },
    {
      path: '/shopfloor/ProductionLine',
      name:'产线管理',
      component: ProductionLineView
    },
    {
      path: '/shopfloor/Workshopinfo',
      name:'车间管理',
      component: WorkshopinfoView
    },
    {
      path: '/shopfloor/WorkStation',
      name:'工作站台',
      component: WorkStationView
    },
  // 班组
    {
      path: '/crew/schedulingPlan',
      name:'班组计划',
      component: SchedulingPlanView
    },
    {
      path: '/crew/teamBill',
      name:'班组设置',
      component: TeamBillView
    },
    {
      path: '/crew/teamType',
      name:'班组类型',
      component: TeamTypeView
    },
     // 工艺
    {
      path: '/processRoute/craftBill',
      name:'工艺路线',
      component: CraftBillView
    },
    {
      path: '/processRoute/process',
      name:'工序',
      component: ProcessView
    },
     // 物料
    {
        path: '/ProductPlanning/Materials',
        name:'原料',
        component: MaterialsView
    },
    {
      path: '/ProductPlanning/productBill',
      name:'物料',
      component: ProductBillView
    },
    {
      path: '/ProductPlanning/ProductClassify',
      name:'物料分类',
      component: ProductClassifyView
    },
    // 生产工单
    {
          path: '/Production/ProductionTask',
          name:'生产任务',
          component: ProductionTaskView
      },
      {
        path: '/Production/WorkOrder',
        name:'生产工单',
        component: WorkOrderView
    },
    // 设备管理
    {
      path: '/equipment/EquipmentManagement',
      name:'设备管理',
      component: EquipmentManagementView
  },
  {
    path: '/equipment/EquipmentClassify',
    name:'设备分类',
    component: EquipmentClassifyView
},
    ],
  },
  {
    path: '/menu',
    name: 'test',
    component: menuView
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})



export default router
